<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">

<ui:composition template="/WEB-INF/template/template.xhtml">
	<ui:define name="content">
		<h:form id="form">

			<div class="middle">
				<h:messages class="myError" id="errors" />
				<h:outputText value="&lt;br/&gt;" escape="false" />
				<h3>
					<h:outputText value="#{msg.BU_createNotification_header}" />
				</h3>
				<h:outputText value="&lt;br/&gt;" escape="false" />
				<h:outputText id="feedback" value="#{notificationBean.feedback}"></h:outputText>
				<h:outputText value="&lt;br/&gt;" escape="false" />
			</div>

			<h:panelGrid class="panelGrid" columns="2" onkeypress="noti">
				<h:outputText
					value="#{msg.BU_createNotification_notificationTable_desc}"></h:outputText>
				<h:inputTextarea id="description" required="true"
					requiredMessage="#{msg.BU_createNotification_requiredMessage}"
					value="#{notificationBean.description}"
					valueChangeListener="#{notificationBean.feedbackRefresh}">
					<f:ajax render="feedback" event="keyup" execute="description" />
				</h:inputTextarea>
				<h:outputText
					value="#{msg.BU_createNotification_notificationTable_problemT}"></h:outputText>
				<h:inputText id="problemType"
					requiredMessage="#{msg.BU_createNotification_requiredMessage2}"
					required="true" value="#{notificationBean.problemType}"
					valueChangeListener="#{notificationBean.feedbackRefresh}">
					<f:ajax render="feedback" event="keyup" execute="problemType" />
				</h:inputText>
				<h:outputText
					value="#{msg.BU_createNotification_notificationTable_resource}"></h:outputText>

				<h:selectOneMenu id="select" value="#{notificationBean.resourceId}"
					valueChangeListener="#{notificationBean.valueChange}"
					required="true"
					requiredMessage="#{msg.BU_createNotification_requiredMessage3}">
					<f:selectItems value="#{notificationBean.resources}" var="res"
						itemLabel="#{res.name}&amp;nbsp;#{res.idnumber}"
						itemValue="#{res.id}" />
					<f:ajax render="resource" event="click" />
				</h:selectOneMenu>
			</h:panelGrid>


			<div class="middle">
				<h:outputText value="&lt;br/&gt;" escape="false" />
				<h:inputTextarea disabled="true" id="resource"
					value="#{notificationBean.detail}" />
				<h:outputText value="&lt;br/&gt;" escape="false" />
				<h:outputText value="&lt;br/&gt;" escape="false" />

				<h:commandButton class="button"
					value="#{msg.BU_createNotification_button1}"
					actionListener="#{notificationBean.insertTechTicket}">
				</h:commandButton>

				<h:commandButton class="button"
					value="#{msg.BU_createNotification_button2}"
					actionListener="#{notificationBean.updateNotification}">
					<f:attribute name="idTicket" value="-1"></f:attribute>
				</h:commandButton>

				<h:commandButton value="#{msg.BU_createNotification_button3}"
					class="button"
					actionListener="#{userPageBean.setPage('viewNotificationHistory')}"
					immediate="true"></h:commandButton>
				<h:outputText value="&lt;br/&gt;" escape="false" />
			</div>

		</h:form>

	</ui:define>
</ui:composition>
</html>